set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NERVER)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

option(USE_ARMGCC "USE ARM GCC" ON)

if(USE_ARMGCC)
    set(COMPILER_ROOT_PATH /usr/local/arm/gcc-arm-none-eabi-10.3-2021.10/bin)
    set(CMAKE_C_COMPILER ${COMPILER_ROOT_PATH}/arm-none-eabi-gcc)
    set(CMAKE_ASM_COMPILER ${COMPILER_ROOT_PATH}/arm-none-eabi-gcc)
    set(CMAKE_OBJCOPY ${COMPILER_ROOT_PATH}/arm-none-eabi-objcopy)
    set(CMAKE_SIEZE ${COMPILER_ROOT_PATH}/arm-none-eabi-size)
endif()
